import time


class Cost(object):
    def __init__(self):
        self.start_time = time.time()
        self.cur_time = time.time()

    def print_cost(self, msg):
        print(f"id:{msg} 当前耗时{time.time() - self.cur_time}, 累计耗时{time.time() - self.start_time}")
        self.cur_time = time.time()
